Skip to main content

Create FL server in cloud

Creating and attaching

Now that we have our Arc kubernetes instances attached and compute instance created, there is only thing we are missing - a federated learning server. In case you want to utilize your own Arc instance as a server, skip this step. Otherwise, we can head to the "Attached computes" tab (also visible in Fig. 4).

Fig. 7 - Attaching VM for executing jupyter notebooks

Here we however notice that we are currently not able to create a VM from workspace directly (it may be comming in next versions). Thus, we need to head back to the portal.azure.com and create new "Virtual Machine" resource.

The selection here depends very much on what you expect the machine to do. In case we only expect the machine to aggregate the results and send data to MLFlow, we are fine off with something like "Standard DS4 v2" VM. We probably can go even lower, however note, that VM needs to be able to hold the weights of NN (several actually, depending on the number of clients) in RAM, in order to do aggregation properly. "DS4 v2" haven't have had any problems during our experiments with NVFlare and 4 clients training "DenseNet169" model via MONAI. Your mileage may vary though. Also, as of now (April 2023), the AML seems only to be supporting virtual machines with Ubuntu.

Fig. 8 - Attaching VM for cloud server

You can pick arbitrary name for compute name, it doesn't have to match VM' name. For resource ID, you will need information from the VM' screen. You should be able to find any of those when you open the VM in portal.azure.com. SSH port, username and password should match the ones selected on the VM. You can find SSH port in "Networking" tab of VM (usually port 22), username and password/ssh key were selected/generated during VM creation.

Networking of the server

In the same "Networking" tab, you will also need to open 2 ports for the server. We resorted to using 8002 and 8003, but unless you pick some port with specified function (80, 443, 22...), you should be oukay with any port. You only need to unlock them for inboud connections (Inboud port rules). This will be needed later when specifying NVFlare project for provisioning. For more information, please see this video. NEVER OPEN MORE PORTS THAN NEEDED!

In the same manner, you will also need a DNS name for the VM, so clients can direct the data flow to the machine. In the overview of VM (where you found subscription, subscription id...), there is a attribute called "DNS name". You will need to set this one. The IP doesn't need to be static. For more information, see this MS tutorial.

Now we assume that VM to launch jupyter (Compute instances tab) is created, Arc kubernetes clusters are connected and server is created as well. Great, it is time to actually head towards executing the code!